<div class="container">
	<div class="row row-offcanvas row-offcanvas-right">
		<ol class="breadcrumb">
		  	<?php if(!$this->currentCatagory) {?>
		  		<li class="active"><a href="<?= WEB_PATH?>">Home</a></li>
		  	<?php } else {?>
		  		<li><a href="<?= WEB_PATH?>">Home</a></li>
		  		<li class="active"><a href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>"><?=$this->currentCatagory->name?></a></li>
		  	<?php }?>
		</ol>
		<div class="col-xs-12 col-sm-9">
			<p class="pull-right visible-xs">
				<button type="button" class="btn btn-primary btn-xs"
					data-toggle="offcanvas">Toggle nav</button>
			</p>
			
			<!-- Display phones -->
			<?php if ($this->paginator->getTotalItemCount() > 0) {?>
			<div class="row">
				<?php foreach ($this->paginator as $phone) {?>
				<div class="col-6 col-sm-6 col-lg-4">
					<p>
					<a href="<?=WEB_PATH?>/phone/detail/id/<?=$phone->id ?>">
						<img alt="" src="<?=WEB_PATH?>/public/imgs/<?=$phone->image_url?>" class="img-max-width">
					</a>
					<span><?=$phone->name ?></span> <br/>
					<span id="phone-price"><?=$phone->price ?></span> <br/>
					<a class="btn btn-default" href="<?=WEB_PATH?>/phone/detail/id/<?=$phone->id ?>">Chi Tiết &raquo;</a>
					<a class="btn btn-success" href="<?=WEB_PATH?>/customer/addtocart/id/<?=$phone->id ?>">Mua hàng</a>
					</p>
				</div>
				<!--/span-->
				<?php }?>
			</div>
			<?php }else { ?>
				<h4>Không tìm thấy</h4>
			<?php }?>
			<!--/row-->
			
			<!-- Pagination -->
			<?php if ($this->paginator->getPages()->pageCount > 1) {?>
			<div class="text-center">
				<ul class="pagination" id="pagination">
				  <?php $currentPage = $this->paginator->getCurrentPageNumber();?>
				  <li class="<?=$currentPage == 1 ? 'disabled' : '' ?>"><a href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$currentPage - 1?>">&laquo;</a></li>
				  <?php for($i = 1; $i<= $this->paginator->getPages()->pageCount; $i++) {?>
				  	<li class="<?=$currentPage == $i ? 'active' : '' ?>"><a href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$i?>"><?=$i?></a></li>
				  <?php }?>
				  <li class="<?=$currentPage == $this->paginator->getPages()->pageCount? 'disabled' : '' ?>"><a href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$currentPage + 1?>">&raquo;</a></li>
				</ul>
			</div>
			<?php }?>
		</div>
		<!--/span-->

		<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"
			role="navigation">
			<div class="well sidebar-nav">
				<ul class="nav">
					<li>Catagoies</li>
					
					<?php foreach ($this->catagories as $key => $catagory) {?>
						<li><a href="<?=WEB_PATH?>/index/catagory/id/<?=$catagory->id?>"><?=$catagory->name ?></a></li>
					<?php }?>
				</ul>
			</div>
			<!--/.well -->
		</div>
		<!--/span-->
	</div>
	<!--/row-->
	
	
	<hr>

	<footer>
		<p>&copy; Company 2013</p>
	</footer>
</div>
<!--/.container-->